var utils = {
    clone: function (obj, condition){
        if(obj===null || typeof obj !== "object"){
          return obj;
        } else if(Array.isArray(obj)){
          var clonedArr = [];
          obj.forEach(function(element){
              if(condition(element))
                clonedArr.push(utils.clone(element, condition))
          });
          return clonedArr.length > 0 ? clonedArr : null;
        } else{
          let clonedObj = {};
          for(var prop in obj){
            if(obj.hasOwnProperty(prop)){
              clonedObj[prop] = utils.clone(obj[prop], condition);
            }
          }
          return clonedObj;
        }
    },
    options:function(list, label, value) {
      var options = [];
      list.forEach(function(data, index) {
        var _label = data[label];
        var _value = data[value];
        options.push({label:_label, value:_value});
      })

      return options
    }
}
export default utils